﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wrwpf="clr-namespace:WrWpf"
    xmlns:local="clr-namespace:WrWpf.Controls">
    
	<ToolTip x:Key="toolTipCalendarDay" Placement="Right"
		DataContext="{Binding Path=PlacementTarget, RelativeSource={x:Static RelativeSource.Self}}">
		<ToolTip.Background>
			<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
				<GradientStop Color="#FF0024A5" Offset="0"/>
				<GradientStop Color="#FF148CAB" Offset="1"/>
				<GradientStop Color="#FF14A7AE" Offset="0.242"/>
				<GradientStop Color="#FF1676AA" Offset="0.542"/>
				<GradientStop Color="#FE09E4CE" Offset="0.836"/>
			</LinearGradientBrush>
		</ToolTip.Background>
		<TextBlock FontWeight="Bold" Text="{Binding Day}"/>
	</ToolTip>

	<LinearGradientBrush x:Key="WeekendBrush" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#bbcfe9" Offset="0" />
		<GradientStop Color="#8daed9" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TodayBrush" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#fffee4" Offset="0" />
		<GradientStop Color="#ffe9a8" Offset=".4" />
		<GradientStop Color="#ffd767" Offset=".4" />
		<GradientStop Color="#ffe69e" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="HolidayBrush" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#efe3ff" Offset="0" />
		<GradientStop Color="#ddc5ff" Offset=".4" />
		<GradientStop Color="#d1adff" Offset=".4" />
		<GradientStop Color="#dbc0ff" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="SelectedDayBrush" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#ffd9aa" Offset="0" />
		<GradientStop Color="#ffbc6f" Offset=".4" />
		<GradientStop Color="#ffab3f" Offset=".4" />
		<GradientStop Color="#fee07a" Offset="1" />
	</LinearGradientBrush>
	
	<Style TargetType="{x:Type local:CalendarDay}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:CalendarDay}">
					<Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="2" Tag="Border"
                            Height="{TemplateBinding Height}"
                            Padding="{TemplateBinding Padding}">
						<DockPanel HorizontalAlignment="Stretch">
							<CheckBox Name="chk1" IsChecked="{x:Null}" Visibility="{TemplateBinding ShowCheckboxes}"
							Padding="0,0,2,0" />

							<TextBlock Text="{TemplateBinding Day}" 
							DockPanel.Dock="Top"
							FontWeight="Bold"
							FontSize="18">
							</TextBlock>

							<TextBlock Text="{TemplateBinding LunarDay}" 
							DockPanel.Dock="Bottom"
							Foreground="Red"
							FontSize="11"
							VerticalAlignment="Bottom"
							TextAlignment="Right"/>
						</DockPanel>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Foreground" Value="Gray" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsWeekend" Value="True" />
								<Condition Property="IsEnabled" Value="True" />
							</MultiTrigger.Conditions>
							<Setter Property="Background" Value="{StaticResource WeekendBrush}" />
							<Setter Property="Border.BorderBrush" Value="#5d8cc9"/>
							<Setter Property="Border.BorderThickness" Value="1"/>
						</MultiTrigger>
						<Trigger Property="IsToday" Value="True">
							<Setter Property="Background" Value="{StaticResource TodayBrush}" />
							<Setter Property="Border.BorderBrush" Value="Orange"/>
							<Setter Property="Border.BorderThickness" Value="1"/>
						</Trigger>
						<Trigger Property="IsHoliday" Value="True">
							<Setter Property="Background" Value="{StaticResource HolidayBrush}" />
						</Trigger>
						<Trigger Property="IsSelectedDay" Value="True">
							<Setter Property="Background" Value="{StaticResource SelectedDayBrush}" />
							<Setter Property="Border.BorderBrush" Value="Orange"/>
							<Setter Property="Border.BorderThickness" Value="1"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="Border.BorderBrush" Value="Orange"/>
							<Setter Property="Border.BorderThickness" Value="1"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>